const goodsItem = require("./goodsItem")
module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
   
    const UserSchema = new Schema({
      userId: { type: String  },
      username: { type: String  },
      pwd: { type: String  },
      cartList:[
        goodsItem
      ],
      addressList:[{
        "addressId":{type:String},
        "userName":{type:String},
        "streetName":{type:String},
        "postCode":{type: String},
        "tel":{type: String},
        "isDefault":{type:Boolean}
      }]
    })
   
    return mongoose.model('User', UserSchema,'user');
}